<template>
  <div id="box">
    <div class="header">
      <div class="nav">
        <div class="layout-header">
          <i style="font-size: 25px" class="el-icon-s-fold"></i> &nbsp; 数据列表
        </div>
        <div class="main">
          <el-table :data="historyData" border style="width: 100%">
            <el-table-column
              prop="date"
              label="序号"
              width="180"
              align="center"
            >
            </el-table-column>
            <el-table-column
              prop="name"
              label="订餐人"
              width="180"
              align="center"
            >
            </el-table-column>
            <el-table-column prop="address" label="所选套餐" align="center">
            </el-table-column>
            <el-table-column prop="xuan" label="订餐时间" align="center">
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>

    <el-pagination
      @current-change="onPageChange"
      background
      layout="prev, pager, next"
      :total="200"
      style="text-align: right; padding-bottom: 300px; margin-top: 20px"
    >
    </el-pagination>
    <div class="bottom" style="text-align: center">
      <p>Aoure原型设计与制作因为兴趣所以热爱</p>
      <p>We Chat: 13182887326</p>
      <p>文档末经授权禁止商业使用</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      historyData: [],
    };
  },
  mounted() {
    this.onPageChange();
  },
  methods: {
    async onPageChange(page = 1) {
      let ret = await this.$store.dispatch("foods/getUserList", page);
      this.historyData = ret.data.historyData;
      console.log(this.historyData);
    },
  },
};
</script>

<style lang="scss" scoped>
.layout-header {
  font-size: 14px;
  height: 60px;
  line-height: 60px;
  background-color: rgba(242, 242, 242, 1);
  box-shadow: 0 1px 1px rgb(0 0 0 / 10%);
  color: #999;
  padding: 0px 30px;
}
.nav {
  margin: 30px;
}
</style>